package com.ruoyi.production.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.GraftinglabelReturnMapper;
import com.ruoyi.production.domain.GraftinglabelReturn;
import com.ruoyi.production.service.IGraftinglabelReturnService;

/**
 * 嫁接签退回Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-20
 */
@Service
public class GraftinglabelReturnServiceImpl implements IGraftinglabelReturnService
{
    @Autowired
    private GraftinglabelReturnMapper graftinglabelReturnMapper;

    /**
     * 查询嫁接签退回
     *
     * @param graftinglabelReturnId 嫁接签退回ID
     * @return 嫁接签退回
     */
    @Override
    public GraftinglabelReturn selectGraftinglabelReturnById(Long graftinglabelReturnId)
    {
        return graftinglabelReturnMapper.selectGraftinglabelReturnById(graftinglabelReturnId);
    }

    /**
     * 查询嫁接签退回列表
     *
     * @param graftinglabelReturn 嫁接签退回
     * @return 嫁接签退回
     */
    @Override
    public List<GraftinglabelReturn> selectGraftinglabelReturnList(GraftinglabelReturn graftinglabelReturn)
    {
        return graftinglabelReturnMapper.selectGraftinglabelReturnList(graftinglabelReturn);
    }

    /**
     * 新增嫁接签退回
     *
     * @param graftinglabelReturn 嫁接签退回
     * @return 结果
     */
    @Override
    public int insertGraftinglabelReturn(GraftinglabelReturn graftinglabelReturn)
    {
        graftinglabelReturn.setCreateTime(DateUtils.getNowDate());
        graftinglabelReturnMapper.updateGraftinglabelAmount(graftinglabelReturn);
        return graftinglabelReturnMapper.insertGraftinglabelReturn(graftinglabelReturn);
    }

    /**
     * 修改嫁接签退回
     *
     * @param graftinglabelReturn 嫁接签退回
     * @return 结果
     */
    @Override
    public int updateGraftinglabelReturn(GraftinglabelReturn graftinglabelReturn)
    {
        graftinglabelReturn.setUpdateTime(DateUtils.getNowDate());
        return graftinglabelReturnMapper.updateGraftinglabelReturn(graftinglabelReturn);
    }

    /**
     * 批量删除嫁接签退回
     *
     * @param graftinglabelReturnIds 需要删除的嫁接签退回ID
     * @return 结果
     */
    @Override
    public int deleteGraftinglabelReturnByIds(Long[] graftinglabelReturnIds)
    {
        return graftinglabelReturnMapper.deleteGraftinglabelReturnByIds(graftinglabelReturnIds);
    }

    /**
     * 删除嫁接签退回信息
     *
     * @param graftinglabelReturnId 嫁接签退回ID
     * @return 结果
     */
    @Override
    public int deleteGraftinglabelReturnById(Long graftinglabelReturnId)
    {
        return graftinglabelReturnMapper.deleteGraftinglabelReturnById(graftinglabelReturnId);
    }

    /**
     * 获取嫁接签类型
     *
     * @param
     * @return 结果
     */
    @Override
    public List<GraftinglabelReturn> getGraftinglabelType(){
        return graftinglabelReturnMapper.getGraftinglabelType();
    }

    /**
     * 获取退回人
     *
     * @param
     * @return 结果
     */
    @Override
    public List<GraftinglabelReturn> getUserName(){
        return graftinglabelReturnMapper.getUserName();
    }

    /**
     * 获取规格
     *
     * @param graftinglabelTypeId 嫁接签类型ID
     * @return 结果
     */
    @Override
    public List<String> getgraftinglabelSpecification(Long graftinglabelTypeId){
        return graftinglabelReturnMapper.getgraftinglabelSpecification(graftinglabelTypeId);
    }

    /**
     * 获取公司
     *
     * @param graftinglabelTypeId 嫁接签类型ID
     * @return 结果
     */
    @Override
    public List<String> getOriginCompany(Long graftinglabelTypeId){
        return graftinglabelReturnMapper.getOriginCompany(graftinglabelTypeId);
    }

}
